import Cookies from 'js-cookie'

const cookieObjs = {
  TokenKey: 'token',
  gridId: 'gridId'
}

export default {
  removeAll() {
    for (const cookieObjsKey in cookieObjs) {
      Cookies.remove(cookieObjs[cookieObjsKey])
    }
  },
  getToken() {
    return Cookies.get(cookieObjs.TokenKey)
  },
  setToken(token) {
    return Cookies.set(cookieObjs.TokenKey, token)
  },
  removeToken() {
    return Cookies.remove(cookieObjs.TokenKey)
  },
  getGridId() {
    return Cookies.get(cookieObjs.gridId)
  },
  setGridId(gridId) {
    return Cookies.set(cookieObjs.gridId, gridId)
  },
  removeRridId() {
    return Cookies.remove(cookieObjs.gridId)
  }
}
